<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>多种样式的社交网站顶部导航</title>
    <!-- Bootstrap 5 CSS -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <!-- Font Awesome -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        /* 基础共享样式 */
        body {
            font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
            margin: 0;
            padding: 0;
        }
        
        .header-style {
            margin-bottom: 3rem;
            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        }
        
        .style-label {
            background-color: #f1f5f9;
            padding: 1rem;
            font-weight: 600;
            color: #334155;
            border-bottom: 1px solid #e2e8f0;
        }
        
        /* 通用组件样式 */
        .top-links, .logo-section, .main-nav {
            padding: 0.5rem 0;
        }
        
        .container {
            padding-left: 1rem;
            padding-right: 1rem;
        }
        
        .link-with-icon {
            display: flex;
            align-items: center;
            gap: 0.25rem;
            text-decoration: none;
            transition: all 0.2s ease;
        }
        
        .nav-link {
            display: flex;
            align-items: center;
            gap: 0.35rem;
            padding: 0.75rem 1rem;
            text-decoration: none;
            transition: all 0.2s ease;
        }
        
        .user-actions {
            display: flex;
            align-items: center;
            gap: 1rem;
        }
        
        .auth-btn {
            display: flex;
            align-items: center;
            gap: 0.35rem;
            padding: 0.375rem 0.75rem;
            font-weight: 500;
            border-radius: 4px;
            transition: all 0.2s ease;
        }
        
        .search-bar {
            position: relative;
        }
        
        .search-input {
            padding: 0.375rem 0.75rem 0.375rem 2rem;
            border-radius: 20px;
            font-size: 0.875rem;
            transition: all 0.2s ease;
        }
        
        .search-input:focus {
            outline: none;
            width: 250px;
        }
        
        .search-icon {
            position: absolute;
            left: 0.75rem;
            top: 50%;
            transform: translateY(-50%);
        }
        
        /* 样式1：标准蓝白风格 */
        .style-1 .top-links {
            background-color: #f8fafc;
            border-bottom: 1px solid #e2e8f0;
        }
        
        .style-1 .top-links .link-with-icon {
            color: #64748b;
            font-size: 0.875rem;
        }
        
        .style-1 .top-links .link-with-icon:hover {
            color: #2563eb;
        }
        
        .style-1 .logo-section {
            background-color: white;
            border-bottom: 1px solid #e2e8f0;
        }
        
        .style-1 .logo {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            text-decoration: none;
        }
        
        .style-1 .logo-icon {
            font-size: 2rem;
            color: #2563eb;
        }
        
        .style-1 .site-name {
            font-size: 1.75rem;
            font-weight: 700;
            color: #1e293b;
        }
        
        .style-1 .main-nav {
            background-color: white;
            border-bottom: 1px solid #e2e8f0;
        }
        
        .style-1 .nav-link {
            color: #334155;
            font-weight: 500;
            border-radius: 4px 4px 0 0;
        }
        
        .style-1 .nav-link:hover {
            color: #2563eb;
            background-color: #eff6ff;
        }
        
        .style-1 .nav-link.active {
            color: #2563eb;
            background-color: #eff6ff;
            border-bottom: 3px solid #2563eb;
        }
        
        .style-1 .search-input {
            border: 1px solid #cbd5e1;
            width: 200px;
        }
        
        .style-1 .search-input:focus {
            border-color: #2563eb;
            box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
        }
        
        .style-1 .search-icon {
            color: #94a3b8;
        }
        
        .style-1 .user-avatar-placeholder {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background-color: #e2e8f0;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #64748b;
            font-weight: 600;
        }
        
        /* 样式2：深色风格 */
        .style-2 .top-links {
            background-color: #1e293b;
            border-bottom: 1px solid #334155;
        }
        
        .style-2 .top-links .link-with-icon {
            color: #94a3b8;
            font-size: 0.875rem;
        }
        
        .style-2 .top-links .link-with-icon:hover {
            color: #bfdbfe;
        }
        
        .style-2 .logo-section {
            background-color: #0f172a;
            border-bottom: 1px solid #334155;
        }
        
        .style-2 .logo {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            text-decoration: none;
        }
        
        .style-2 .logo-icon {
            font-size: 2rem;
            color: #93c5fd;
        }
        
        .style-2 .site-name {
            font-size: 1.75rem;
            font-weight: 700;
            color: #f8fafc;
        }
        
        .style-2 .main-nav {
            background-color: #0f172a;
            border-bottom: 1px solid #334155;
        }
        
        .style-2 .nav-link {
            color: #e2e8f0;
            font-weight: 500;
            border-radius: 4px 4px 0 0;
        }
        
        .style-2 .nav-link:hover {
            color: #93c5fd;
            background-color: #1e293b;
        }
        
        .style-2 .nav-link.active {
            color: #93c5fd;
            background-color: #1e293b;
            border-bottom: 3px solid #93c5fd;
        }
        
        .style-2 .search-input {
            border: 1px solid #334155;
            background-color: #1e293b;
            color: #e2e8f0;
            width: 200px;
        }
        
        .style-2 .search-input:focus {
            border-color: #93c5fd;
            box-shadow: 0 0 0 2px rgba(147, 197, 253, 0.2);
        }
        
        .style-2 .search-icon {
            color: #94a3b8;
        }
        
        .style-2 .user-avatar-placeholder {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background-color: #334155;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #e2e8f0;
            font-weight: 600;
        }
        
        .style-2 .user-name {
            color: #f8fafc;
        }
        
        /* 样式3：简约风格 */
        .style-3 .top-links {
            background-color: white;
            border-bottom: 1px solid #f1f5f9;
        }
        
        .style-3 .top-links .link-with-icon {
            color: #64748b;
            font-size: 0.875rem;
        }
        
        .style-3 .top-links .link-with-icon:hover {
            color: #0f172a;
        }
        
        .style-3 .logo-section {
            background-color: white;
            border-bottom: 1px solid #f1f5f9;
        }
        
        .style-3 .logo {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            text-decoration: none;
        }
        
        .style-3 .logo-icon {
            font-size: 2rem;
            color: #0f172a;
        }
        
        .style-3 .site-name {
            font-size: 1.75rem;
            font-weight: 600;
            color: #0f172a;
            letter-spacing: -0.5px;
        }
        
        .style-3 .main-nav {
            background-color: white;
            border-bottom: 1px solid #f1f5f9;
        }
        
        .style-3 .nav-link {
            color: #64748b;
            font-weight: 500;
            border-radius: 0;
            position: relative;
        }
        
        .style-3 .nav-link:hover {
            color: #0f172a;
        }
        
        .style-3 .nav-link.active {
            color: #0f172a;
            font-weight: 600;
        }
        
        .style-3 .nav-link.active::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 0;
            width: 100%;
            height: 2px;
            background-color: #0f172a;
        }
        
        .style-3 .search-input {
            border: 1px solid #e2e8f0;
            width: 200px;
        }
        
        .style-3 .search-input:focus {
            border-color: #0f172a;
            box-shadow: none;
        }
        
        .style-3 .search-icon {
            color: #94a3b8;
        }
        
        .style-3 .user-avatar-placeholder {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background-color: #f1f5f9;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #64748b;
            font-weight: 600;
        }
        
        /* 响应式通用调整 */
        @media (max-width: 992px) {
            .top-links-container {
                flex-wrap: wrap;
            }
            
            .nav-links {
                overflow-x: auto;
                padding-bottom: 0.5rem;
                width: 100%;
            }
            
            .search-bar {
                display: none;
            }
        }
        
        @media (max-width: 768px) {
            .top-links-container {
                flex-direction: column;
                gap: 0.5rem;
            }
            
            .left-links, .right-links {
                width: 100%;
                justify-content: center;
                flex-wrap: wrap;
                gap: 1rem;
            }
            
            .site-name {
                font-size: 1.5rem;
            }
            
            .nav-link span:nth-child(2) {
                display: none;
            }
            
            .nav-link {
                padding: 0.75rem;
            }
        }
        
        @media (max-width: 576px) {
            .logo-icon {
                font-size: 1.5rem;
            }
            
            .site-name {
                font-size: 1.25rem;
            }
            
            .auth-btn span:nth-child(2) {
                display: none;
            }
        }
    </style>
</head>
<body>
    <!-- 样式1：标准蓝白风格 -->
    <div class="header-style style-1">
        <div class="style-label">样式1：标准蓝白风格</div>
        
        <!-- 第一排：各种链接 -->
        <div class="top-links">
            <div class="container">
                <div class="d-flex justify-content-between align-items-center top-links-container">
                    <div class="left-links d-flex gap-3">
                        <a href="#" class="link-with-icon">
                            <i class="fas fa-question-circle"></i>
                            <span>帮助中心</span>
                        </a>
                        <a href="#" class="link-with-icon">
                            <i class="fas fa-info-circle"></i>
                            <span>关于我们</span>
                        </a>
                        <a href="#" class="link-with-icon">
                            <i class="fas fa-file-alt"></i>
                            <span>服务条款</span>
                        </a>
                        <a href="#" class="link-with-icon">
                            <i class="fas fa-shield-alt"></i>
                            <span>隐私政策</span>
                        </a>
                    </div>
                    
                    <div class="right-links d-flex gap-3">
                        <a href="#" class="link-with-icon">
                            <i class="fas fa-bell"></i>
                            <span>通知</span>
                        </a>
                        <a href="#" class="link-with-icon">
                            <i class="fas fa-map-marker-alt"></i>
                            <span>地区: 北京</span>
                        </a>
                        <a href="#" class="link-with-icon">
                            <i class="fas fa-language"></i>
                            <span>简体中文</span>
                        </a>
                        <a href="#" class="link-with-icon">
                            <i class="fas fa-headphones"></i>
                            <span>联系客服</span>
                        </a>
                    </div>
                </div>
            </div>
        </div>
        
        <!-- 第二排：Logo与用户信息 -->
        <div class="logo-section">
            <div class="container">
                <div class="d-flex justify-content-between align-items-center">
                    <a href="#" class="logo">
                        <div class="logo-icon">
                            <i class="fas fa-comments"></i>
                        </div>
                        <div class="site-name">社交空间</div>
                    </a>
                    
                    <!-- 未登录状态 -->
                    <div class="user-actions" id="guest-actions-1">
                        <button class="auth-btn btn btn-outline-primary">
                            <i class="fas fa-user-plus"></i>
                            <span>注册</span>
                        </button>
                        <button class="auth-btn btn btn-primary">
                            <i class="fas fa-sign-in-alt"></i>
                            <span>登录</span>
                        </button>
                    </div>
                    
                    <!-- 登录状态（默认隐藏） -->
                    <div class="user-actions" id="user-actions-1" style="display: none;">
                        <div class="d-flex align-items-center gap-2">
                            <div class="user-avatar-placeholder">
                                <i class="fas fa-user"></i>
                            </div>
                            <div class="user-name">用户名</div>
                            <div class="user-menu-toggle">
                                <i class="fas fa-chevron-down"></i>
                            </div>
                        </div>
                        <button class="auth-btn btn btn-outline-danger">
                            <i class="fas fa-sign-out-alt"></i>
                            <span>退出</span>
                        </button>
                    </div>
                </div>
            </div>
        </div>
        
        <!-- 第三排：栏目展示 -->
        <div class="main-nav">
            <div class="container">
                <div class="d-flex justify-content-between align-items-center">
                    <div class="nav-links d-flex">
                        <a href="#" class="nav-link active">
                            <i class="fas fa-home"></i>
                            <span>首页</span>
                        </a>
                        <a href="#" class="nav-link">
                            <i class="fas fa-compass"></i>
                            <span>发现</span>
                        </a>
                        <a href="#" class="nav-link">
                            <i class="fas fa-users"></i>
                            <span>好友</span>
                        </a>
                        <a href="#" class="nav-link">
                            <i class="fas fa-thumbtack"></i>
                            <span>专题</span>
                        </a>
                        <a href="#" class="nav-link">
                            <i class="fas fa-calendar-alt"></i>
                            <span>活动</span>
                        </a>
                        <a href="#" class="nav-link">
                            <i class="fas fa-store"></i>
                            <span>商城</span>
                        </a>
                        <a href="#" class="nav-link">
                            <i class="fas fa-newspaper"></i>
                            <span>资讯</span>
                        </a>
                    </div>
                    
                    <div class="search-bar">
                        <i class="fas fa-search search-icon"></i>
                        <input type="text" class="search-input" placeholder="搜索内容...">
                    </div>
                </div>
            </div>
        </div>
    </div>
    
    <!-- 样式2：深色风格 -->
    <div class="header-style style-2">
        <div class="style-label">样式2：深色风格</div>
        
        <!-- 第一排：各种链接 -->
        <div class="top-links">
            <div class="container">
                <div class="d-flex justify-content-between align-items-center top-links-container">
                    <div class="left-links d-flex gap-3">
                        <a href="#" class="link-with-icon">
                            <i class="fas fa-question-circle"></i>
                            <span>帮助中心</span>
                        </a>
                        <a href="#" class="link-with-icon">
                            <i class="fas fa-info-circle"></i>
                            <span>关于我们</span>
                        </a>
                        <a href="#" class="link-with-icon">
                            <i class="fas fa-file-alt"></i>
                            <span>服务条款</span>
                        </a>
                        <a href="#" class="link-with-icon">
                            <i class="fas fa-shield-alt"></i>
                            <span>隐私政策</span>
                        </a>
                    </div>
                    
                    <div class="right-links d-flex gap-3">
                        <a href="#" class="link-with-icon">
                            <i class="fas fa-bell"></i>
                            <span>通知</span>
                        </a>
                        <a href="#" class="link-with-icon">
                            <i class="fas fa-map-marker-alt"></i>
                            <span>地区: 上海</span>
                        </a>
                        <a href="#" class="link-with-icon">
                            <i class="fas fa-language"></i>
                            <span>简体中文</span>
                        </a>
                        <a href="#" class="link-with-icon">
                            <i class="fas fa-headphones"></i>
                            <span>联系客服</span>
                        </a>
                    </div>
                </div>
            </div>
        </div>
        
        <!-- 第二排：Logo与用户信息 -->
        <div class="logo-section">
            <div class="container">
                <div class="d-flex justify-content-between align-items-center">
                    <a href="#" class="logo">
                        <div class="logo-icon">
                            <i class="fas fa-connectdevelop"></i>
                        </div>
                        <div class="site-name">社交矩阵</div>
                    </a>
                    
                    <!-- 未登录状态 -->
                    <div class="user-actions" id="guest-actions-2">
                        <button class="auth-btn btn btn-outline-info">
                            <i class="fas fa-user-plus"></i>
                            <span>注册</span>
                        </button>
                        <button class="auth-btn btn btn-info">
                            <i class="fas fa-sign-in-alt"></i>
                            <span>登录</span>
                        </button>
                    </div>
                    
                    <!-- 登录状态（默认隐藏） -->
                    <div class="user-actions" id="user-actions-2" style="display: none;">
                        <div class="d-flex align-items-center gap-2">
                            <div class="user-avatar-placeholder">
                                <i class="fas fa-user"></i>
                            </div>
                            <div class="user-name">用户名</div>
                            <div class="user-menu-toggle">
                                <i class="fas fa-chevron-down"></i>
                            </div>
                        </div>
                        <button class="auth-btn btn btn-outline-light">
                            <i class="fas fa-sign-out-alt"></i>
                            <span>退出</span>
                        </button>
                    </div>
                </div>
            </div>
        </div>
        
        <!-- 第三排：栏目展示 -->
        <div class="main-nav">
            <div class="container">
                <div class="d-flex justify-content-between align-items-center">
                    <div class="nav-links d-flex">
                        <a href="#" class="nav-link active">
                            <i class="fas fa-home"></i>
                            <span>首页</span>
                        </a>
                        <a href="#" class="nav-link">
                            <i class="fas fa-compass"></i>
                            <span>发现</span>
                        </a>
                        <a href="#" class="nav-link">
                            <i class="fas fa-users"></i>
                            <span>好友</span>
                        </a>
                        <a href="#" class="nav-link">
                            <i class="fas fa-star"></i>
                            <span>推荐</span>
                        </a>
                        <a href="#" class="nav-link">
                            <i class="fas fa-calendar-alt"></i>
                            <span>活动</span>
                        </a>
                        <a href="#" class="nav-link">
                            <i class="fas fa-gamepad"></i>
                            <span>游戏</span>
                        </a>
                        <a href="#" class="nav-link">
                            <i class="fas fa-video"></i>
                            <span>视频</span>
                        </a>
                    </div>
                    
                    <div class="search-bar">
                        <i class="fas fa-search search-icon"></i>
                        <input type="text" class="search-input" placeholder="搜索内容...">
                    </div>
                </div>
            </div>
        </div>
    </div>
    
    <!-- 样式3：简约风格 -->
    <div class="header-style style-3">
        <div class="style-label">样式3：简约风格</div>
        
        <!-- 第一排：各种链接 -->
        <div class="top-links">
            <div class="container">
                <div class="d-flex justify-content-between align-items-center top-links-container">
                    <div class="left-links d-flex gap-3">
                        <a href="#" class="link-with-icon">
                            <i class="fas fa-question-circle"></i>
                            <span>帮助</span>
                        </a>
                        <a href="#" class="link-with-icon">
                            <i class="fas fa-info-circle"></i>
                            <span>关于</span>
                        </a>
                        <a href="#" class="link-with-icon">
                            <i class="fas fa-file-alt"></i>
                            <span>条款</span>
                        </a>
                        <a href="#" class="link-with-icon">
                            <i class="fas fa-shield-alt"></i>
                            <span>隐私</span>
                        </a>
                    </div>
                    
                    <div class="right-links d-flex gap-3">
                        <a href="#" class="link-with-icon">
                            <i class="fas fa-bell"></i>
                            <span>通知</span>
                        </a>
                        <a href="#" class="link-with-icon">
                            <i class="fas fa-map-marker-alt"></i>
                            <span>城市</span>
                        </a>
                        <a href="#" class="link-with-icon">
                            <i class="fas fa-language"></i>
                            <span>语言</span>
                        </a>
                        <a href="#" class="link-with-icon">
                            <i class="fas fa-headphones"></i>
                            <span>客服</span>
                        </a>
                    </div>
                </div>
            </div>
        </div>
        
        <!-- 第二排：Logo与用户信息 -->
        <div class="logo-section">
            <div class="container">
                <div class="d-flex justify-content-between align-items-center">
                    <a href="#" class="logo">
                        <div class="logo-icon">
                            <i class="fas fa-link"></i>
                        </div>
                        <div class="site-name">连接</div>
                    </a>
                    
                    <!-- 未登录状态 -->
                    <div class="user-actions" id="guest-actions-3">
                        <button class="auth-btn btn btn-outline-dark">
                            <i class="fas fa-user-plus"></i>
                            <span>注册</span>
                        </button>
                        <button class="auth-btn btn btn-dark">
                            <i class="fas fa-sign-in-alt"></i>
                            <span>登录</span>
                        </button>
                    </div>
                    
                    <!-- 登录状态（默认隐藏） -->
                    <div class="user-actions" id="user-actions-3" style="display: none;">
                        <div class="d-flex align-items-center gap-2">
                            <div class="user-avatar-placeholder">
                                <i class="fas fa-user"></i>
                            </div>
                            <div class="user-name">用户名</div>
                            <div class="user-menu-toggle">
                                <i class="fas fa-chevron-down"></i>
                            </div>
                        </div>
                        <button class="auth-btn btn btn-outline-dark">
                            <i class="fas fa-sign-out-alt"></i>
                            <span>退出</span>
                        </button>
                    </div>
                </div>
            </div>
        </div>
        
        <!-- 第三排：栏目展示 -->
        <div class="main-nav">
            <div class="container">
                <div class="d-flex justify-content-between align-items-center">
                    <div class="nav-links d-flex">
                        <a href="#" class="nav-link active">
                            <i class="fas fa-home"></i>
                            <span>首页</span>
                        </a>
                        <a href="#" class="nav-link">
                            <i class="fas fa-compass"></i>
                            <span>发现</span>
                        </a>
                        <a href="#" class="nav-link">
                            <i class="fas fa-users"></i>
                            <span>好友</span>
                        </a>
                        <a href="#" class="nav-link">
                            <i class="fas fa-bookmark"></i>
                            <span>收藏</span>
                        </a>
                        <a href="#" class="nav-link">
                            <i class="fas fa-hashtag"></i>
                            <span>话题</span>
                        </a>
                        <a href="#" class="nav-link">
                            <i class="fas fa-newspaper"></i>
                            <span>资讯</span>
                        </a>
                    </div>
                    
                    <div class="search-bar">
                        <i class="fas fa-search search-icon"></i>
                        <input type="text" class="search-input" placeholder="搜索...">
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!-- Bootstrap 5 JS Bundle with Popper -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
    <script>
        // 为所有样式初始化交互功能
        document.addEventListener('DOMContentLoaded', function() {
            // 初始化三个样式的登录/注册功能
            for (let i = 1; i <= 3; i++) {
                const loginBtn = document.querySelector(`#guest-actions-${i} .btn:not(.btn-outline)`);
                const registerBtn = document.querySelector(`#guest-actions-${i} .btn-outline`);
                const logoutBtn = document.querySelector(`#user-actions-${i} .btn`);
                const guestActions = document.getElementById(`guest-actions-${i}`);
                const userActions = document.getElementById(`user-actions-${i}`);
                
                // 模拟登录功能
                loginBtn.addEventListener('click', function() {
                    guestActions.style.display = 'none';
                    userActions.style.display = 'flex';
                    alert('登录成功！');
                });
                
                // 模拟注册功能
                registerBtn.addEventListener('click', function() {
                    alert('跳转到注册页面');
                });
                
                // 模拟退出功能
                logoutBtn.addEventListener('click', function() {
                    userActions.style.display = 'none';
                    guestActions.style.display = 'flex';
                    alert('已退出登录');
                });
                
                // 用户菜单切换
                const userMenuToggle = document.querySelector(`#user-actions-${i} .user-menu-toggle`);
                userMenuToggle.addEventListener('click', function() {
                    alert('显示用户菜单：个人主页、设置、消息等');
                });
            }
            
            // 导航链接激活状态切换
            const navLinks = document.querySelectorAll('.nav-link');
            navLinks.forEach(link => {
                link.addEventListener('click', function(e) {
                    e.preventDefault();
                    
                    // 获取同组的所有导航链接
                    const siblingLinks = this.closest('.nav-links').querySelectorAll('.nav-link');
                    
                    // 移除同组所有链接的激活状态
                    siblingLinks.forEach(l => l.classList.remove('active'));
                    
                    // 为当前点击的链接添加激活状态
                    this.classList.add('active');
                });
            });
            
            // 搜索框交互
            const searchInputs = document.querySelectorAll('.search-input');
            searchInputs.forEach(input => {
                input.addEventListener('keydown', function(e) {
                    if (e.key === 'Enter') {
                        e.preventDefault();
                        if (this.value.trim()) {
                            alert(`搜索内容：${this.value}`);
                        }
                    }
                });
            });
            
            // 顶部链接交互
            const topLinks = document.querySelectorAll('.link-with-icon');
            topLinks.forEach(link => {
                link.addEventListener('click', function(e) {
                    e.preventDefault();
                    const linkText = this.querySelector('span').textContent;
                    alert(`跳转到：${linkText}`);
                });
            });
        });
    </script>
</body>
</html>
    
